﻿using System;
using System.Linq;
using WebExam.DataEntities;

namespace WebExam.DataProvider
{
    public interface IYXRepository
    {
        /// <summary>
        /// 获取院系信息
        /// </summary>
        /// <param name="start">开始位置</param>
        /// <param name="takeSize">获取条数</param>
        IQueryable<YX> GetAll(int start, int takeSize);

        /// <summary>
        /// 获取院系信息
        /// </summary>
        /// <param name="yxId">院系Id</param>
        YX Get(int yxId);

        /// <summary>
        /// 添加院系信息
        /// </summary>
        /// <param name="yx">院系对象</param>
        YX Add(YX yx);

        /// <summary>
        /// 更新院系信息
        /// </summary>
        /// <param name="yxId">院系Id</param>
        /// <param name="update">包含更新操作的方法</param>
        YX Update(int yxId, Action<YX> update);

        /// <summary>
        /// 删除院系信息
        /// </summary>
        /// <param name="yxId">院系Id</param>
        bool Delete(int yxId);

        /// <summary>
        /// 统计院系个数
        /// </summary>
        int Count();
    }
}